/**
 * 
 */
package com.jw.server.model;

import javax.persistence.Entity;

import cn.ydx.protobuf.OTIpcDef;

/**
 * @author Jason Biao
 * 
 * 
 *         网约车平台公司支付信息
 */
@Entity
public class BaseInfoCompanyPay extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8151605622029807204L;

	private String payName;

	private String payId;

	private String payType;

	private String payScope;

	private String prepareBank;

	private String countDate;

	private int state;
	
	public String getPayName() {
		return payName;
	}

	public void setPayName(String payName) {
		this.payName = payName;
	}

	public String getPayId() {
		return payId;
	}

	public void setPayId(String payId) {
		this.payId = payId;
	}

	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}

	public String getPayScope() {
		return payScope;
	}

	public void setPayScope(String payScope) {
		this.payScope = payScope;
	}

	public String getPrepareBank() {
		return prepareBank;
	}

	public void setPrepareBank(String prepareBank) {
		this.prepareBank = prepareBank;
	}

	public String getCountDate() {
		return countDate;
	}

	public void setCountDate(String countDate) {
		this.countDate = countDate;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}


    @Override
	public String toString() {
		return "BaseInfoCompanyPay [payName=" + payName + ", payId=" + payId
				+ ", payType=" + payType + ", payScope=" + payScope
				+ ", prepareBank=" + prepareBank + ", countDate=" + countDate
				+ ", state=" + state + "]";
	}

	public static OTIpcDef.BaseInfoCompanyPay convert(BaseInfoCompanyPay data){
        OTIpcDef.BaseInfoCompanyPay item = OTIpcDef.BaseInfoCompanyPay.newBuilder()
                .setCompanyId(data.getCompanyId())
                .setPayName(data.getPayName())
                .setPayId(data.getPayId())
                .setPayType(data.getPayType())
                .setPayScope(data.getPayScope())
                .setPrepareBank(data.getPrepareBank())
                .setCountDate(Integer.parseInt(data.getCountDate()))
                .setState(data.getState())
                .setFlag(data.getFlag())
                .setUpdateTime(Long.valueOf(data.getUpdateTime()))
                .build();

        return item;
    }
	
	public  static BaseInfoCompanyPay  convertPojo(OTIpcDef.BaseInfoCompanyPay bd){
		BaseInfoCompanyPay bicy=new BaseInfoCompanyPay();
		bicy.setCompanyId(bd.getCompanyId());
		bicy.setCountDate(bd.getCountDate()+"");
		bicy.setFlag(bd.getFlag());
		bicy.setPayId(bd.getPayId());
		bicy.setPayName(bd.getPayName());
		bicy.setPayScope(bd.getPayScope());
		bicy.setPayType(bd.getPayType());
		bicy.setPrepareBank(bd.getPrepareBank());
		bicy.setState(bd.getState());
		bicy.setUpdateTime(bd.getUpdateTime());
		return bicy;
	}
}
